/**
 *  The confidential and proprietary information contained in this file may
 *   only be used by a person authorised under and to the extent permitted
 *  by a subsisting licensing agreement from ARM Limited or its affiliates.
 *
 *        (C) COPYRIGHT 2019 ARM Limited or its affiliates
 *                       ALL RIGHTS RESERVED
 *
 *       This entire notice must be reproduced on all copies of this file
 *   and copies of this file may only be made by a person if such person is
 *    permitted to do so under the terms of a subsisting license agreement
 *                  from ARM Limited or its affiliates.
 *
 */ 

#include "acamera_command_api.h"
//#include "acamera_firmware_api.h"
#include "acamera_firmware_settings.h"

// created from 2019-08-07T11:23:20.882Z UTCstatic_calibrations(linear isp)-imx290-20190807.json

// CALIBRATION_BLACK_LEVEL_R
static uint16_t _calibration_black_level_r[][2]
 =  {
  { 0, 241 },
  { 32, 240 },
  { 64, 240 },
  { 96, 240 },
  { 128, 240 },
  { 160, 238 },
  { 192, 236 }
};

// CALIBRATION_BLACK_LEVEL_GR
static uint16_t _calibration_black_level_gr[][2]
 =  {
  { 0, 241 },
  { 32, 240 },
  { 64, 240 },
  { 96, 240 },
  { 128, 240 },
  { 160, 238 },
  { 192, 236 }
};

// CALIBRATION_BLACK_LEVEL_GB
static uint16_t _calibration_black_level_gb[][2]
 =  {
  { 0, 241 },
  { 32, 240 },
  { 64, 240 },
  { 96, 240 },
  { 128, 240 },
  { 160, 238 },
  { 192, 236 }
};

// CALIBRATION_BLACK_LEVEL_B
static uint16_t _calibration_black_level_b[][2]
 =  {
  { 0, 241 },
  { 32, 240 },
  { 64, 240 },
  { 96, 240 },
  { 128, 240 },
  { 160, 238 },
  { 192, 236 }
};

// CALIBRATION_NOISE_PROFILE
static uint8_t _calibration_noise_profile[]
 = {0,0,0,0,0,0,0,1,25,36,41,45,47,50,51,53,54,56,57,58,59,60,60,61,62,63,63,63,64,65,65,66,66,67,67,68,68,68,69,69,69,70,70,70,71,71,71,72,72,72,73,73,73,73,74,74,74,74,74,75,75,75,75,76,76,76,76,76,77,77,77,77,77,77,78,78,78,78,78,78,79,79,79,79,79,79,80,80,80,80,80,80,80,81,81,81,81,81,81,81,81,82,82,82,82,82,82,82,82,82,83,83,83,83,83,83,83,83,83,84,84,84,84,84,84,84,84,84};

// CALIBRATION_DEMOSAIC
static uint8_t _calibration_demosaic[]
 = {1,17,27,31,34,37,39,41,42,44,45,46,47,48,49,50,51,51,52,53,53,53,54,55,55,56,56,57,57,57,58,58,59,59,59,60,60,60,61,61,61,61,62,62,62,62,63,63,63,63,64,64,64,64,65,65,65,65,65,66,66,66,66,66,67,67,67,67,67,67,68,68,68,68,68,68,68,69,69,69,69,69,69,70,70,70,70,70,70,70,70,71,71,71,71,71,71,71,71,72,72,72,72,72,72,72,72,72,73,73,73,73,73,73,73,73,73,73,74,74,74,74,74,74,74,74,74,74};

// 8-bit normalised noise profile for WDR stitching
static uint8_t _calibration_wdr_np_lut[]
 = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};

// CALIBRATION_SHADING_RADIAL_R
static uint16_t _calibration_shading_radial_r[]
 = {4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096};

// CALIBRATION_SHADING_RADIAL_G
static uint16_t _calibration_shading_radial_g[]
 = {4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096};

// CALIBRATION_SHADING_RADIAL_B
static uint16_t _calibration_shading_radial_b[]
 = {4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096};

// CALIBRATION_SHADING_RADIAL_IR
static uint16_t _calibration_shading_radial_ir[]
 = {4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096};

// RX RY MULTRX MULTRY GX GY MULTGX MULTGY BX BY MULTBX MULTBY IRX IRY MULTIRX MULTIRY
static uint16_t _calibration_shading_radial_centre_and_mult[]
 = {960,540,1770,1770,960,540,1770,1770,960,540,1770,1770,960,540,1770,1770};

// CALIBRATION_SHADING_LS_A_R
static uint8_t _calibration_shading_ls_a_r[]
 = {148,134,122,114,108,102,97,93,90,87,84,82,80,79,78,78,78,78,79,80,81,83,85,87,90,94,97,102,107,113,124,135,144,133,120,112,106,100,96,92,88,85,83,80,79,77,76,76,76,76,77,78,79,81,83,86,89,92,96,100,105,112,122,132,138,128,118,110,104,99,94,90,86,83,81,79,77,76,75,74,74,74,75,76,78,79,81,84,87,90,94,98,103,110,119,128,135,125,115,108,102,96,92,88,84,82,79,77,76,74,73,73,73,73,74,75,76,78,79,82,85,88,92,96,101,107,116,125,131,122,113,106,100,95,90,86,83,80,78,76,74,73,72,71,71,72,72,73,74,76,78,80,83,87,90,95,100,105,114,122,128,119,111,104,98,93,89,85,81,79,76,74,73,71,70,70,70,70,71,72,73,74,76,79,82,85,89,93,98,104,112,120,126,117,108,102,96,91,87,83,80,77,75,73,71,70,69,69,69,69,69,70,72,73,75,78,80,84,87,91,96,102,110,118,123,115,107,100,95,90,85,82,79,76,74,72,70,69,68,67,67,68,68,69,70,72,74,76,79,82,86,90,95,100,108,116,122,113,105,99,93,88,84,81,77,75,73,70,69,68,67,66,66,67,67,68,69,71,73,75,78,81,85,89,94,99,107,114,120,112,104,97,92,87,83,80,76,74,71,69,68,67,66,66,65,66,66,67,69,70,72,75,77,80,84,88,93,98,105,113,119,111,102,96,91,86,82,79,76,73,71,69,67,66,65,65,65,65,66,66,68,69,71,74,76,80,83,87,92,98,105,111,117,109,101,95,90,86,82,78,75,72,70,68,67,65,65,65,65,65,65,66,67,69,71,73,76,79,83,87,91,97,104,111,116,108,101,95,90,85,81,77,75,72,70,68,66,65,65,64,64,65,65,65,67,68,70,73,75,79,82,86,91,97,104,110,115,107,100,94,89,85,81,77,74,71,69,67,66,65,65,64,64,64,65,65,66,68,70,72,75,78,82,86,91,96,103,110,114,107,100,94,89,84,80,77,74,71,69,67,66,65,65,64,64,64,65,65,66,68,70,72,75,78,82,86,91,96,103,110,113,106,99,93,88,84,80,76,73,71,69,67,65,65,65,64,64,64,65,65,66,67,69,72,74,78,81,86,90,96,103,110,113,106,99,93,88,83,80,76,73,70,68,67,65,65,64,64,64,64,64,65,66,67,69,72,74,78,81,85,90,96,103,110,112,105,98,93,88,83,80,76,73,70,68,67,65,65,64,64,64,64,64,65,66,67,69,71,74,77,81,85,90,96,103,109,112,105,98,92,88,83,79,76,73,71,68,67,65,65,64,64,64,64,64,65,66,67,69,72,74,78,81,86,90,96,103,109,113,106,99,93,88,84,80,76,73,71,69,67,65,65,65,64,64,64,65,65,66,67,69,72,75,78,82,86,91,97,103,110,113,106,99,93,88,84,80,77,74,71,69,67,66,65,65,65,65,65,65,65,66,68,70,72,75,78,82,86,91,97,104,111,114,107,100,94,89,85,81,77,74,72,69,68,66,65,65,65,65,65,65,66,67,68,70,73,76,79,83,87,92,98,105,112,115,108,101,95,90,85,82,78,75,72,70,68,67,66,65,65,65,65,66,66,67,69,71,74,76,80,83,88,93,99,106,113,116,109,102,96,91,86,82,79,76,73,71,69,68,66,66,66,66,66,66,67,68,70,72,74,77,81,84,89,94,100,107,114,118,111,103,97,92,87,83,80,77,74,72,70,69,67,67,66,66,66,67,68,69,71,73,75,78,82,85,90,95,101,108,115,120,112,105,98,93,89,85,81,78,75,73,71,70,68,67,67,67,67,68,69,70,72,74,76,79,83,87,91,97,103,110,117,121,114,106,100,94,90,85,82,79,76,74,72,70,69,68,68,68,68,69,70,71,73,75,77,80,84,88,92,98,104,111,119,123,115,107,101,96,91,87,83,80,77,75,73,72,70,69,69,69,69,70,71,72,74,76,78,82,85,89,94,99,106,113,120,125,117,109,103,97,92,88,84,81,79,76,74,73,71,71,70,70,70,71,72,73,75,77,80,83,86,90,95,101,107,115,122,128,120,111,104,99,94,89,86,83,80,78,76,74,73,72,71,71,72,72,73,75,76,79,81,84,88,92,97,102,109,117,124,131,123,114,106,101,95,91,88,84,81,79,77,75,74,73,73,73,73,74,75,76,78,80,83,86,89,94,99,104,111,119,127,134,124,115,108,102,97,93,89,86,83,80,79,77,76,75,74,74,75,75,76,77,79,82,84,87,91,95,100,106,113,121,129};

// CALIBRATION_SHADING_LS_A_G
static uint8_t _calibration_shading_ls_a_g[]
 = {133,121,111,104,99,94,90,87,84,82,79,78,76,75,75,74,74,75,75,76,77,79,80,82,84,87,90,93,97,103,111,121,129,120,110,103,97,93,89,86,83,80,78,77,75,74,74,73,73,73,74,75,76,77,79,81,83,86,89,92,96,102,110,118,124,116,107,101,96,91,87,84,81,79,77,75,74,73,72,72,72,72,72,73,74,76,77,79,82,84,87,91,95,100,108,115,121,113,105,99,94,90,86,83,80,78,76,74,73,72,71,71,71,71,71,72,73,74,76,78,80,83,86,89,93,98,105,113,118,111,103,97,92,88,85,82,79,77,75,73,72,71,70,69,69,70,70,71,72,73,75,77,79,81,85,88,92,97,103,110,116,109,101,96,91,87,83,80,78,75,73,72,70,69,69,68,68,68,69,70,71,72,74,75,78,80,83,87,90,95,102,108,114,107,100,94,90,86,82,79,77,74,72,71,69,68,68,67,67,67,68,68,69,71,72,74,77,79,82,85,89,94,100,106,112,105,98,93,88,84,81,78,75,73,71,70,68,67,67,66,66,66,67,68,69,70,72,73,76,78,81,84,88,93,99,105,110,104,97,92,87,83,80,77,75,72,70,69,67,67,66,65,65,66,66,67,68,69,71,73,75,77,80,84,87,92,98,104,109,102,96,91,87,83,79,76,74,72,70,68,67,66,65,65,65,65,65,66,67,68,70,72,74,77,80,83,87,91,97,103,108,102,95,90,86,82,79,76,73,71,69,67,66,65,65,64,64,64,65,65,67,68,70,72,74,76,79,82,86,90,96,102,107,101,94,90,85,81,78,75,73,71,69,67,66,65,64,64,64,64,65,65,66,68,69,71,73,76,79,82,86,90,96,101,106,100,94,89,85,81,78,75,72,70,68,67,65,65,64,64,64,64,64,65,66,67,69,71,73,75,78,82,85,90,95,101,105,99,93,89,84,81,77,75,72,70,68,67,65,65,64,64,64,64,64,65,66,67,68,71,73,75,78,82,85,90,95,101,105,99,93,88,84,80,77,74,72,70,68,66,65,65,64,64,64,64,64,65,65,67,68,70,73,75,78,81,85,90,95,101,104,98,93,88,84,80,77,74,72,69,68,66,65,65,64,64,64,64,64,65,65,66,68,70,72,75,78,81,85,90,95,101,104,98,92,88,83,80,77,74,71,69,67,66,65,65,64,64,64,64,64,64,65,66,68,70,72,75,78,81,85,89,95,100,103,98,92,88,83,80,77,74,71,69,67,66,65,65,64,64,64,64,64,64,65,66,68,70,72,75,78,81,85,89,95,100,103,98,92,87,83,80,77,74,71,69,67,66,65,65,64,64,64,64,64,65,65,66,68,70,72,75,78,81,85,90,95,101,104,98,92,88,84,80,77,74,72,70,68,66,65,65,64,64,64,64,64,65,65,67,68,70,72,75,78,81,85,90,96,101,104,99,93,88,84,80,77,74,72,70,68,66,65,65,65,64,64,65,65,65,66,67,69,71,73,75,79,82,86,91,96,102,105,99,94,89,85,81,78,75,73,70,68,67,66,65,65,65,65,65,65,65,66,67,69,71,73,76,79,83,87,91,97,102,106,100,94,90,85,82,78,76,73,71,69,67,66,65,65,65,65,65,65,66,67,68,70,72,74,77,80,83,88,92,98,103,107,101,95,90,86,82,79,76,74,72,70,68,67,66,66,65,65,65,66,66,67,69,70,72,75,77,81,84,88,93,99,104,108,102,96,91,87,83,80,77,75,72,70,69,68,67,66,66,66,66,66,67,68,69,71,73,76,78,81,85,89,94,100,106,110,104,98,92,88,84,81,78,75,73,71,70,68,67,67,66,66,66,67,68,69,70,72,74,76,79,82,86,90,95,101,107,111,105,99,93,89,85,82,79,76,74,72,71,69,68,67,67,67,67,68,68,70,71,73,75,77,80,83,87,91,96,102,108,113,106,100,95,90,86,83,80,77,75,73,71,70,69,68,68,68,68,69,69,71,72,74,76,78,81,84,88,92,97,104,110,115,108,101,96,91,87,84,81,78,76,74,72,71,70,69,69,69,69,70,70,71,73,75,77,79,82,85,89,93,99,105,111,117,110,103,97,93,88,85,82,79,77,75,74,72,71,70,70,70,70,71,71,73,74,76,78,80,83,87,90,95,100,107,113,119,113,105,99,94,90,87,83,81,78,76,75,73,73,72,71,71,71,72,73,74,75,77,79,82,85,88,92,97,102,109,115,122,115,107,101,95,91,88,85,82,79,78,76,75,74,73,73,72,73,73,74,75,77,78,80,83,86,89,93,98,104,110,117};

// CALIBRATION_SHADING_LS_A_B
static uint8_t _calibration_shading_ls_a_b[]
 = {100,94,89,86,84,82,80,78,76,75,74,72,72,71,71,70,70,70,70,70,71,72,72,73,74,75,75,76,76,78,81,86,98,94,89,86,84,81,80,78,76,74,73,72,71,70,70,69,69,69,70,70,70,71,72,72,73,74,75,75,76,78,82,86,96,92,88,85,83,81,79,77,75,74,72,71,70,70,69,69,68,68,69,69,70,70,71,71,72,73,74,75,76,77,81,85,95,91,87,85,82,80,78,76,74,73,72,71,70,69,68,68,68,68,68,68,69,69,70,71,72,73,74,74,75,77,81,84,94,90,87,84,82,80,77,76,74,72,71,70,69,68,68,67,67,67,67,68,68,69,70,71,71,72,74,74,75,77,80,84,93,89,86,83,81,78,77,75,73,72,70,69,68,67,67,67,67,66,67,67,68,68,69,70,71,72,73,74,75,76,80,83,92,88,85,82,80,78,76,74,72,71,70,68,68,67,66,66,66,66,66,66,67,68,68,69,70,71,72,73,74,76,79,82,91,87,84,81,79,77,75,73,72,70,69,68,67,66,66,65,65,65,65,66,66,67,68,69,70,71,72,73,74,75,79,82,90,87,83,81,79,76,74,73,71,70,69,67,66,66,65,65,65,65,65,65,66,67,67,68,70,71,72,73,74,75,78,81,90,86,83,80,78,76,74,72,71,69,68,67,66,65,65,64,64,64,65,65,66,66,67,68,69,70,72,72,73,75,78,81,89,85,82,80,78,75,74,72,71,69,68,67,66,65,65,64,64,64,64,65,65,66,67,68,69,70,71,72,74,75,79,81,88,85,82,79,77,75,73,72,70,69,68,66,65,65,64,64,64,64,64,65,65,66,67,68,69,70,71,73,74,75,79,82,88,85,81,79,77,75,73,71,70,68,67,66,65,65,64,64,64,64,64,65,65,66,67,68,69,70,72,73,74,76,79,82,87,84,80,78,77,75,73,71,70,68,67,66,65,65,64,64,64,64,64,64,65,66,67,68,69,70,72,73,75,76,79,82,87,84,80,78,76,74,73,71,70,68,67,66,65,65,64,64,64,64,65,65,65,65,67,68,69,70,72,73,75,76,79,82,86,83,80,78,76,75,73,71,70,68,67,66,65,65,65,64,64,64,64,64,65,66,67,68,69,70,72,73,75,77,79,82,85,83,80,78,76,74,73,71,69,68,67,66,65,65,65,64,64,64,64,64,65,66,67,67,69,70,72,74,75,77,80,83,85,82,79,78,76,74,72,71,69,68,67,66,65,64,64,64,64,64,65,64,65,65,67,68,69,70,72,73,75,77,80,83,85,82,80,78,76,74,72,71,69,68,67,66,65,65,64,64,64,64,64,65,65,66,67,68,69,70,72,74,75,78,80,83,85,83,80,78,76,74,73,71,69,68,67,66,65,65,65,65,65,64,65,64,65,66,67,68,69,71,72,74,76,78,81,83,85,82,80,78,77,75,73,71,70,68,67,66,65,65,65,65,65,65,65,65,65,66,67,68,70,71,73,75,76,79,81,84,85,83,81,79,77,75,73,71,70,69,68,67,66,65,65,65,65,65,65,65,66,67,68,69,70,71,73,75,77,79,82,85,86,83,81,79,77,76,74,72,71,69,68,67,66,66,65,65,65,65,65,66,66,67,68,69,71,72,74,76,78,80,83,85,87,84,82,79,78,76,74,72,71,70,68,68,67,66,66,66,66,66,66,66,67,68,69,70,71,73,74,76,78,80,83,86,88,85,83,80,78,77,75,73,72,70,69,68,67,67,66,66,66,66,66,67,67,68,69,71,72,73,75,77,79,81,84,86,88,86,83,81,79,77,75,74,72,71,70,69,68,67,67,66,66,66,67,67,68,69,70,71,73,74,76,78,80,82,84,87,89,86,84,82,79,77,76,74,73,71,70,69,68,68,67,67,67,67,67,68,69,70,70,72,73,74,76,78,80,83,85,88,90,87,85,82,80,78,76,75,73,72,71,70,69,68,68,67,67,68,68,68,69,70,71,72,73,75,76,79,81,83,86,88,91,88,85,83,81,78,77,75,74,73,71,70,70,69,68,68,68,68,68,69,70,71,72,73,74,75,77,79,81,84,86,89,92,89,86,84,81,79,77,76,75,74,72,71,70,70,69,69,69,69,69,70,70,71,72,73,75,76,78,80,82,84,87,90,93,90,87,84,82,80,78,77,75,74,73,72,71,71,70,70,70,70,70,71,71,72,73,74,76,77,79,81,83,85,88,91,94,91,88,85,83,81,79,77,76,75,74,73,72,71,71,71,70,71,71,72,72,73,74,75,77,78,80,81,84,86,89,92};

// CALIBRATION_SHADING_LS_TL84_R
static uint8_t _calibration_shading_ls_tl84_r[]
 = {157,141,126,116,109,103,98,94,91,88,85,84,82,81,80,79,80,80,81,82,84,86,88,91,95,99,104,111,119,129,143,158,150,138,124,114,107,101,96,92,89,86,84,82,80,79,78,78,78,79,79,80,82,84,86,89,93,97,102,109,116,126,140,152,142,132,120,111,104,99,94,90,87,84,82,80,78,77,77,76,76,77,77,78,80,82,84,87,91,95,100,106,113,122,134,145,137,127,116,108,102,96,92,88,85,82,80,78,77,75,75,74,74,75,75,77,78,80,82,85,89,93,98,103,110,118,130,141,133,123,113,106,100,94,90,86,83,81,78,77,75,74,73,73,73,73,74,75,77,78,81,84,87,91,95,101,107,116,126,136,129,120,111,103,98,93,88,85,82,79,77,75,74,73,72,71,71,72,72,74,75,77,79,82,85,89,93,99,105,112,122,132,126,117,108,101,95,91,87,83,80,78,75,74,72,71,70,70,70,70,71,72,73,75,78,80,84,87,92,97,103,110,120,129,123,114,106,99,94,89,85,82,79,76,74,72,71,70,69,69,69,69,70,71,72,74,76,79,82,86,90,95,101,108,117,126,120,112,105,97,92,88,84,80,77,75,73,71,69,68,68,68,67,68,68,69,71,73,75,77,81,84,88,93,99,106,114,123,118,110,103,96,91,86,83,79,76,74,71,70,68,67,67,66,66,67,67,68,70,72,74,76,79,83,87,92,97,104,112,120,115,108,101,94,90,85,81,78,75,73,70,69,67,66,66,65,66,66,66,67,69,71,73,75,78,81,86,90,96,102,110,118,114,107,100,94,88,84,80,77,74,72,70,68,67,66,65,65,65,65,66,67,68,70,72,74,77,81,85,89,94,101,109,117,113,106,99,92,88,83,80,76,73,71,69,67,66,65,65,65,65,65,65,66,67,69,71,73,76,80,84,88,94,100,108,116,112,105,98,92,87,83,79,76,73,71,69,67,65,65,65,65,65,65,65,66,67,68,70,73,76,79,83,88,93,99,107,115,111,104,97,91,86,82,78,75,73,70,68,67,65,65,65,64,65,65,65,65,66,68,70,73,76,79,83,87,92,99,106,114,111,104,97,91,86,82,78,75,72,70,68,66,65,65,65,64,64,65,65,65,66,68,70,72,75,79,82,87,92,98,106,113,110,103,96,91,86,82,78,75,72,70,68,66,65,65,64,64,64,65,65,65,66,68,70,72,75,78,82,87,92,97,105,113,110,103,96,90,86,82,78,75,72,69,68,66,65,64,64,64,64,64,65,65,66,67,69,72,75,78,82,86,91,97,105,112,110,103,96,90,85,81,78,74,72,69,67,66,65,64,64,64,64,64,65,65,66,67,69,72,74,78,82,86,91,97,104,112,109,103,96,90,85,81,78,74,72,69,67,66,65,64,64,64,64,64,64,65,66,67,69,72,75,78,82,86,91,97,104,112,110,103,96,90,86,81,78,75,72,70,68,66,65,64,64,64,64,64,64,65,66,67,69,72,75,78,82,86,91,97,104,112,110,103,96,91,86,82,78,75,72,70,68,66,65,65,64,64,64,64,64,65,66,68,70,72,75,78,82,86,91,97,105,112,111,104,97,91,86,82,78,75,72,70,68,67,65,64,64,64,64,64,65,65,66,68,70,73,75,79,83,87,92,98,105,113,112,105,98,92,87,83,79,76,73,71,69,67,66,65,64,65,65,65,65,66,67,69,71,73,76,79,83,88,93,99,106,114,114,106,99,93,88,84,80,77,74,72,70,68,67,66,65,65,65,65,66,66,68,69,71,74,77,80,84,88,94,100,107,115,115,108,100,94,89,85,81,78,75,73,71,69,67,66,66,66,65,66,66,67,68,70,72,75,78,81,85,89,95,101,109,117,117,109,101,95,90,86,82,79,76,74,71,70,68,67,67,66,66,67,67,68,69,71,73,76,79,82,86,91,96,102,110,118,119,111,103,96,91,87,83,80,77,74,72,71,69,68,68,67,67,67,68,69,70,72,74,77,80,83,87,91,97,104,112,120,121,112,104,98,92,88,84,81,78,76,74,72,70,69,68,68,68,68,69,70,71,73,75,78,81,84,88,93,98,105,114,122,123,115,106,99,93,89,85,82,79,76,74,73,71,70,69,69,69,69,70,71,72,74,76,79,82,85,89,94,100,107,116,124,126,117,108,101,95,90,86,83,80,78,76,74,72,71,71,70,70,71,71,72,73,75,77,80,83,87,91,96,102,109,118,127,128,118,109,102,96,91,87,84,81,79,77,75,73,72,72,71,71,72,72,73,74,76,78,81,84,88,92,97,103,110,120,129};

// CALIBRATION_SHADING_LS_TL84_G
static uint8_t _calibration_shading_ls_tl84_g[]
 = {149,135,121,112,106,100,95,92,88,86,84,82,80,79,79,78,78,79,79,80,82,84,86,89,92,96,101,107,114,123,136,149,143,132,118,110,104,98,93,90,87,84,82,80,79,78,77,77,77,77,78,79,80,82,85,87,91,94,99,105,112,120,133,144,136,126,115,107,101,96,91,88,85,82,80,78,77,76,75,75,75,75,76,77,78,80,83,85,88,92,97,102,109,117,128,138,132,122,112,105,99,94,90,86,83,81,78,77,75,74,74,73,73,74,74,75,77,79,81,83,87,90,95,100,106,114,124,134,127,118,109,102,96,92,88,84,81,79,77,75,74,73,72,72,72,72,73,74,75,77,79,82,85,89,93,98,104,111,120,129,124,116,107,100,95,90,86,83,80,78,76,74,73,71,71,70,70,71,72,73,74,76,78,80,83,87,91,96,102,109,118,126,121,113,105,98,93,88,85,81,79,76,74,73,71,70,69,69,69,70,70,71,73,74,76,79,82,85,89,94,100,107,115,123,118,111,103,97,91,87,83,80,77,75,73,71,70,69,68,68,68,68,69,70,71,73,75,78,80,84,88,92,98,105,113,121,116,109,101,95,90,86,82,79,76,74,72,70,69,68,67,67,67,67,68,69,70,72,74,76,79,82,86,91,96,103,110,118,114,107,100,93,89,84,81,78,75,73,71,69,68,67,66,66,66,66,67,68,69,71,73,75,78,81,85,90,95,101,109,116,112,105,98,92,87,83,80,77,74,72,70,68,67,66,65,65,65,66,66,67,68,70,72,74,77,80,84,88,93,100,107,114,111,104,97,91,86,82,79,76,73,71,69,67,66,65,65,65,65,65,65,66,68,69,71,74,76,79,83,87,92,98,105,113,110,103,96,90,86,82,78,75,73,70,68,67,66,65,65,65,65,65,65,66,67,69,71,73,76,79,82,87,91,97,104,111,109,102,96,90,85,81,78,75,72,70,68,66,65,65,65,65,65,65,65,65,67,68,70,72,75,78,82,86,91,96,104,111,108,102,95,89,85,81,77,74,72,70,68,66,65,65,64,64,64,65,65,65,66,68,70,72,75,78,81,85,90,96,103,110,108,101,94,89,84,80,77,74,71,69,67,66,65,65,64,64,64,65,65,65,66,67,69,72,74,77,81,85,90,96,102,109,107,101,94,89,84,80,77,74,71,69,67,66,65,65,64,64,64,65,65,65,66,67,69,71,74,77,81,85,89,95,102,109,107,100,94,88,84,80,77,74,71,69,67,66,65,64,64,64,64,64,65,65,66,67,69,71,74,77,80,84,89,95,101,108,107,100,94,88,84,80,77,74,71,69,67,66,65,64,64,64,64,64,65,65,66,67,69,71,74,77,80,84,89,95,102,108,107,100,94,88,84,80,77,74,71,69,67,65,64,64,64,64,64,64,64,65,65,67,69,71,74,77,80,84,89,95,101,108,107,100,94,88,84,80,77,74,71,69,67,66,64,64,64,64,64,64,64,65,66,67,69,71,74,77,80,84,89,95,102,108,107,101,94,89,84,80,77,74,71,69,67,66,65,64,64,64,64,64,64,65,66,67,69,71,74,77,81,85,89,95,102,109,108,101,95,89,85,81,77,74,72,70,68,66,65,64,64,64,64,64,64,65,66,68,69,72,74,77,81,85,90,96,103,109,109,102,95,90,85,81,78,75,72,70,68,67,65,65,64,64,64,64,65,65,67,68,70,72,75,78,82,86,90,96,103,110,110,103,96,91,86,82,79,75,73,71,69,67,66,65,65,64,64,65,65,66,67,69,71,73,76,79,82,86,91,97,104,111,111,104,97,92,87,83,79,76,74,72,70,68,67,66,65,65,65,65,66,67,68,69,71,74,76,79,83,87,92,98,105,112,113,106,99,93,88,84,80,77,75,72,70,69,68,67,66,66,66,66,67,67,69,70,72,74,77,80,84,88,93,99,107,114,115,107,100,94,89,85,81,78,75,73,71,70,68,67,67,66,66,67,67,68,69,71,73,75,78,81,85,89,94,101,108,116,117,109,101,95,90,86,82,79,76,74,72,70,69,68,68,67,67,68,68,69,70,72,74,76,79,82,86,90,96,102,109,117,119,111,103,96,91,87,83,80,77,75,73,72,70,69,69,68,68,69,69,70,71,73,75,77,80,83,87,92,97,103,111,119,121,113,105,98,93,88,84,81,78,76,74,72,71,70,70,69,69,70,70,71,72,74,76,78,81,84,89,93,98,105,113,121,124,115,106,99,94,89,85,82,79,77,75,73,72,71,71,70,70,70,71,72,73,75,77,79,82,85,89,94,99,106,115,123};

// CALIBRATION_SHADING_LS_TL84_B
static uint8_t _calibration_shading_ls_tl84_b[]
 = {139,127,115,107,101,96,92,89,86,84,82,80,79,78,78,77,77,78,78,80,81,82,84,87,91,94,99,104,110,118,130,141,134,124,113,105,99,95,91,88,85,82,80,79,78,77,76,76,76,76,77,78,80,81,83,86,89,92,97,102,108,116,127,137,128,119,110,103,98,93,89,86,83,81,79,77,76,75,74,74,74,75,76,76,78,79,81,84,87,91,94,100,106,113,123,132,125,116,107,101,95,91,87,84,81,79,78,76,75,74,73,73,73,73,74,75,76,78,80,83,85,89,93,98,103,110,119,128,121,113,105,99,94,89,86,83,80,77,76,75,74,72,72,72,72,71,73,74,75,76,79,81,84,87,91,96,101,107,115,124,118,111,103,97,92,87,84,81,79,77,75,73,72,71,70,70,70,71,71,72,74,75,77,79,82,86,89,94,99,105,113,121,115,108,101,95,91,87,83,80,77,75,74,72,71,70,69,69,69,70,70,71,72,74,76,78,81,84,88,92,97,103,111,119,112,106,99,93,89,85,81,79,76,74,72,71,70,69,68,68,68,68,69,70,71,73,74,77,79,83,86,90,96,101,109,116,111,104,97,92,87,84,80,78,75,73,71,70,69,68,67,67,67,67,68,69,70,72,73,76,78,81,85,89,94,99,107,114,109,103,96,91,86,83,79,76,74,72,70,69,68,67,66,66,66,66,67,68,69,71,72,75,77,80,84,88,92,98,105,111,107,101,95,90,85,81,78,76,73,71,69,68,67,66,66,65,65,66,66,67,68,70,72,74,76,79,83,87,91,96,103,110,106,100,94,89,84,81,78,75,73,71,69,67,66,65,65,65,65,65,66,67,68,69,71,73,76,79,82,86,90,95,102,109,105,99,93,88,84,80,77,74,72,70,68,67,66,65,65,65,65,65,65,66,67,69,70,72,75,78,81,85,89,95,101,108,105,99,93,87,83,80,77,74,72,69,68,67,66,65,65,65,65,65,65,66,67,68,70,72,75,77,81,85,89,94,101,107,104,98,92,87,83,79,76,73,71,69,68,66,65,65,65,65,65,65,65,66,66,68,70,72,74,77,80,84,89,94,100,106,103,97,92,87,82,79,76,73,71,69,68,66,65,65,65,65,65,65,65,66,66,68,69,71,74,77,80,84,88,93,99,106,103,97,91,86,82,79,76,73,71,69,67,66,65,65,65,65,65,65,65,66,66,67,69,71,73,76,80,84,88,93,99,105,102,97,91,86,82,79,75,73,71,69,67,66,65,65,64,65,65,65,65,65,66,67,69,71,73,76,79,83,87,92,98,104,102,96,90,86,82,78,75,73,71,68,67,66,64,65,64,64,65,65,65,65,66,67,69,71,73,76,79,83,87,92,98,104,102,96,91,86,82,78,75,73,70,69,67,66,65,65,64,64,64,64,65,65,66,67,69,71,73,76,79,83,87,92,98,104,102,96,91,86,82,78,75,73,70,69,67,66,65,65,64,64,64,65,65,65,66,67,69,71,73,76,79,83,87,93,98,104,102,96,91,86,82,79,76,73,71,69,67,66,65,65,64,64,64,65,65,65,66,67,69,71,73,76,79,83,87,92,98,105,103,98,92,87,83,79,76,73,71,69,67,66,65,65,64,64,64,65,65,65,66,67,69,71,74,77,79,83,88,93,99,105,104,98,92,87,83,80,77,74,72,70,68,66,66,65,65,65,65,65,65,66,67,68,70,72,74,77,80,84,88,94,100,106,105,99,93,88,84,80,77,75,72,71,69,67,66,65,65,65,65,65,65,66,67,69,71,72,75,78,81,85,89,94,101,107,106,100,94,89,85,81,78,75,73,71,69,68,67,66,65,65,65,66,66,67,68,69,71,73,75,78,82,86,90,95,102,108,108,102,95,90,85,82,79,76,74,71,70,68,67,66,66,66,66,66,67,67,69,70,72,74,76,79,82,86,91,96,103,109,109,102,96,91,86,83,79,77,74,72,71,69,68,67,67,66,66,67,67,68,69,71,72,74,77,80,83,87,92,97,104,110,111,104,97,92,87,83,80,77,75,73,71,70,69,68,67,67,67,68,68,69,70,71,73,75,78,81,84,88,93,99,105,111,112,105,99,93,88,85,81,78,76,74,72,71,70,69,68,68,68,68,69,70,71,72,74,76,79,82,85,89,94,100,106,113,114,107,100,95,90,86,82,79,77,75,73,72,71,70,69,69,69,69,70,71,71,73,75,77,80,83,86,90,95,101,108,115,116,108,101,96,91,87,83,80,78,76,74,73,71,71,70,70,70,70,71,71,72,74,76,78,81,84,87,91,96,102,110,117};

// CALIBRATION_SHADING_LS_D65_R
static uint8_t _calibration_shading_ls_d65_r[]
 = {151,137,125,116,109,103,98,94,91,88,85,83,82,81,80,79,79,80,80,81,83,85,87,90,94,98,103,109,115,125,138,151,145,134,122,113,107,101,96,92,89,86,84,81,80,79,78,77,77,78,78,79,81,83,85,88,92,96,101,106,113,122,135,146,138,129,118,110,104,98,94,90,87,84,82,80,78,77,76,76,75,76,76,77,79,81,83,86,90,93,98,104,110,118,130,140,134,124,115,108,101,96,92,88,85,82,80,78,76,75,74,74,74,74,75,76,77,79,81,84,87,91,96,101,107,115,126,136,129,120,112,105,100,94,90,86,83,80,78,76,75,73,73,72,72,72,73,74,75,77,79,82,85,89,94,99,105,113,122,132,126,118,109,103,98,92,88,84,81,79,77,74,73,72,71,71,71,71,71,72,74,76,78,80,84,88,92,97,103,110,119,129,123,115,107,101,95,91,87,83,80,77,75,73,72,70,70,69,69,70,70,71,72,74,77,79,82,86,90,95,101,108,117,126,121,113,106,99,94,89,85,82,79,76,74,72,71,69,69,68,68,68,69,70,71,73,75,78,81,85,89,94,100,106,115,123,119,111,104,98,92,88,84,80,77,75,73,71,69,68,67,67,67,67,68,69,70,72,74,77,80,83,87,92,98,104,113,121,117,110,102,96,91,87,83,79,76,74,72,70,68,67,67,66,66,66,67,68,69,71,73,76,79,82,86,91,97,103,111,119,115,108,101,95,90,85,82,78,75,73,71,69,67,67,66,65,65,66,66,67,68,70,72,75,78,81,85,90,95,101,109,117,114,107,100,94,89,84,81,77,75,72,70,68,67,66,65,65,65,65,65,66,68,69,71,74,77,80,84,89,94,100,108,116,113,106,99,93,88,84,80,77,74,71,69,67,66,65,65,65,65,65,65,66,67,69,71,73,76,79,83,88,93,100,107,114,111,105,98,92,87,83,79,76,73,71,69,67,65,65,65,64,64,65,65,65,67,68,70,73,75,79,83,87,92,99,106,114,110,104,97,92,87,83,79,76,73,70,68,67,65,65,64,64,64,64,65,65,66,68,70,72,75,78,82,87,92,98,106,113,110,103,96,91,86,82,78,75,72,70,68,66,65,65,64,64,64,64,64,65,66,67,69,72,75,78,82,86,91,97,105,112,110,103,96,91,86,82,78,75,72,70,68,66,65,64,64,64,64,64,65,65,66,67,69,72,75,78,81,86,91,97,104,112,109,103,96,91,86,82,78,75,72,70,68,66,65,64,64,64,64,64,64,65,66,67,69,72,74,78,81,86,91,97,104,112,109,103,96,91,86,82,78,75,72,70,68,66,65,64,64,64,64,64,65,65,66,67,69,72,74,78,81,86,91,97,104,112,109,102,96,90,86,82,78,75,72,70,68,66,65,64,64,64,64,64,65,65,66,67,69,72,75,77,81,86,91,97,105,112,109,103,97,91,86,82,79,75,73,70,68,66,65,65,65,64,64,64,65,65,66,67,69,72,75,78,82,86,91,98,105,112,110,104,97,92,87,83,79,76,73,71,68,67,65,65,64,64,64,64,65,65,66,68,70,72,75,79,82,87,92,98,106,113,111,104,97,92,88,83,80,76,74,71,69,67,66,65,65,65,65,65,65,66,67,68,70,73,76,79,83,88,93,99,107,114,112,106,99,93,88,84,80,77,74,72,70,68,66,66,65,65,65,65,65,66,67,69,71,73,76,80,84,88,93,100,107,115,114,106,100,94,89,85,81,78,75,72,70,68,67,66,66,65,65,65,66,67,68,70,72,74,77,80,84,89,94,101,108,116,115,108,101,95,90,86,82,79,76,73,71,69,68,67,66,66,66,66,67,68,69,70,72,75,78,82,86,90,96,102,110,117,117,109,102,96,91,87,83,80,77,74,72,70,69,68,67,67,67,67,68,69,70,71,74,76,79,83,86,91,97,103,111,119,118,111,103,97,92,88,84,81,78,76,73,71,70,69,68,68,68,68,69,70,71,72,75,77,80,84,88,92,98,105,113,121,120,112,105,99,94,89,85,82,79,76,74,72,71,70,69,69,69,69,70,71,72,74,76,79,81,85,89,94,100,107,115,123,122,115,107,100,95,91,87,83,80,78,76,74,72,71,70,70,70,70,71,72,73,75,77,80,83,86,91,95,101,108,117,126,124,117,109,102,97,92,88,85,82,79,77,75,73,72,72,71,71,71,72,73,75,76,79,81,84,88,92,97,103,111,120,128,127,118,111,104,98,93,89,86,83,80,78,76,75,73,73,72,72,73,73,74,76,78,80,83,86,89,94,99,105,112,122,131};

// CALIBRATION_SHADING_LS_D65_G
static uint8_t _calibration_shading_ls_d65_g[]
 = {145,132,119,111,104,99,94,90,87,85,82,81,79,78,77,77,77,77,78,79,80,82,84,86,89,93,97,102,109,117,128,139,140,129,117,109,102,97,93,89,86,83,81,79,78,77,76,75,75,75,76,77,78,80,82,85,87,91,95,100,107,114,125,135,133,124,113,106,100,95,90,87,84,81,79,77,76,75,74,74,74,74,74,75,77,78,80,83,86,89,93,98,104,111,121,130,129,120,111,103,98,93,89,85,82,80,78,76,74,73,73,72,72,72,73,74,75,77,79,81,84,87,91,96,101,108,117,126,125,117,108,101,96,91,87,83,81,78,76,74,73,72,71,71,71,71,71,72,74,75,77,79,82,85,89,94,99,106,114,123,122,114,106,99,94,89,85,82,79,77,75,73,72,71,70,69,69,69,70,71,72,74,76,78,81,84,88,92,97,104,112,120,120,112,104,98,92,88,84,81,78,75,74,72,70,69,69,68,68,68,69,70,71,73,74,77,79,83,86,91,96,102,110,117,117,110,102,96,91,86,83,80,77,74,72,71,69,68,68,67,67,67,68,69,70,72,73,76,78,81,85,89,94,100,108,115,115,108,101,95,90,85,82,79,76,73,71,70,68,67,67,66,66,66,67,68,69,71,72,75,77,80,84,88,93,99,106,113,113,106,99,93,89,84,81,78,75,73,71,69,67,67,66,66,65,66,66,67,68,70,72,74,76,79,83,87,92,98,105,111,112,105,98,92,88,84,80,77,74,72,70,68,67,66,65,65,65,65,66,66,67,69,71,73,76,79,82,86,91,96,103,110,111,104,97,91,87,83,79,76,73,71,69,67,66,65,65,65,65,65,65,66,67,68,70,72,75,78,81,85,90,95,102,109,110,103,96,91,86,82,78,75,73,71,68,67,66,65,64,64,64,64,65,65,66,68,70,72,74,77,81,85,89,95,101,108,109,102,96,90,85,81,78,75,72,70,68,67,65,65,64,64,64,64,65,65,66,67,69,71,74,77,80,84,89,94,100,107,108,101,95,89,85,81,78,74,72,70,68,66,65,64,64,64,64,64,64,65,66,67,69,71,73,76,80,84,88,93,100,106,107,101,95,89,85,81,77,74,72,69,67,66,65,64,64,64,64,64,64,65,65,67,68,70,73,76,79,83,88,93,99,106,107,100,94,89,84,80,77,74,71,69,67,66,65,64,64,64,64,64,64,65,65,66,68,70,73,76,79,83,87,93,99,106,107,100,94,89,84,80,77,74,71,69,67,66,65,64,64,64,64,64,64,65,65,66,68,70,73,76,79,83,87,93,99,106,107,101,94,89,84,80,77,74,71,69,67,66,65,64,64,64,64,64,64,65,65,66,68,70,73,76,79,83,87,93,99,105,107,101,94,89,85,81,77,74,72,69,67,66,65,64,64,64,64,64,64,65,65,67,68,70,73,76,79,83,88,93,99,106,107,101,95,89,85,81,77,74,72,70,68,66,65,65,64,64,64,64,64,65,66,67,69,71,73,76,80,83,88,93,100,106,108,102,95,90,85,81,78,75,72,70,68,66,65,65,64,64,64,64,65,65,66,67,69,71,73,77,80,84,88,94,100,107,109,102,96,90,86,82,78,75,73,70,68,67,66,65,65,64,64,65,65,65,66,68,69,72,74,77,80,84,89,94,101,107,110,103,96,91,86,82,79,76,73,71,69,67,66,65,65,65,65,65,65,65,67,68,70,72,75,77,81,85,89,95,102,108,111,104,97,92,87,83,79,77,74,72,69,68,67,66,65,65,65,65,65,66,67,69,70,73,75,78,81,86,90,96,103,109,112,105,98,93,88,84,80,77,75,72,70,69,67,66,66,65,65,65,66,67,68,69,71,73,76,79,82,86,91,97,104,111,113,107,100,94,89,85,81,78,75,73,71,69,68,67,66,66,66,66,67,68,69,70,72,74,77,80,83,87,92,98,105,112,116,108,101,95,90,86,82,79,76,74,72,70,69,68,67,67,67,67,68,69,70,71,73,75,78,81,84,89,94,100,107,114,118,110,103,97,91,87,83,80,77,75,73,72,70,69,68,68,68,68,69,70,71,72,74,76,79,82,86,90,95,101,109,116,120,112,104,98,93,88,85,81,79,76,74,73,71,70,69,69,69,69,70,71,72,73,75,77,80,83,87,91,97,103,110,118,122,115,107,100,95,90,86,83,80,77,75,74,72,71,71,70,70,70,71,72,73,75,77,79,82,85,89,93,98,105,113,121,125,116,108,101,96,91,87,84,81,79,76,75,74,73,72,71,71,71,72,73,74,76,78,80,83,86,90,94,100,106,115,123};

// CALIBRATION_SHADING_LS_D65_B
static uint8_t _calibration_shading_ls_d65_b[]
 = {133,122,112,105,100,95,91,87,85,82,80,79,77,77,76,75,75,76,76,77,78,79,81,84,86,90,93,98,103,110,119,129,128,120,110,103,98,93,89,86,83,81,79,78,76,75,74,74,74,74,75,76,77,78,80,82,85,88,92,96,102,108,117,126,123,115,107,100,96,91,88,84,82,79,78,76,75,74,73,73,73,73,73,74,75,77,78,81,83,86,90,94,99,105,114,121,120,112,104,98,94,89,86,83,80,78,76,74,73,72,72,71,71,72,72,73,74,75,77,79,82,85,88,92,97,103,110,118,117,109,102,96,92,88,84,81,79,76,75,73,72,71,70,70,70,70,71,71,72,74,76,78,80,83,87,91,95,101,108,115,114,107,100,95,90,86,83,80,78,75,73,72,71,70,69,69,69,69,70,70,71,73,75,77,79,82,85,89,93,99,106,113,111,105,99,93,89,85,82,79,76,74,72,71,70,69,68,68,68,68,69,69,70,72,73,75,78,81,84,88,92,97,104,110,110,103,97,92,87,84,80,78,75,73,72,70,69,68,67,67,67,67,68,69,69,71,73,74,77,80,83,87,91,96,102,109,108,102,96,91,87,83,80,77,75,73,71,69,68,67,67,66,66,66,67,68,69,70,72,74,76,79,82,86,90,95,101,107,107,101,95,90,86,82,79,76,74,72,70,68,67,66,66,66,65,66,66,67,68,69,71,73,75,78,81,85,89,94,100,105,105,99,94,89,85,81,78,75,73,71,69,68,67,66,65,65,65,65,66,66,67,69,70,72,74,77,80,84,88,93,99,104,104,99,93,88,84,80,78,75,72,70,69,67,66,65,65,65,65,65,65,66,67,68,70,72,74,76,80,83,87,92,97,103,103,98,92,87,83,80,77,74,72,70,68,67,66,65,65,65,65,65,65,65,66,68,69,71,73,76,79,82,86,91,97,103,102,97,91,87,83,79,76,74,71,69,68,66,65,64,64,64,64,64,65,65,66,67,69,71,73,75,78,82,86,90,96,102,102,96,91,86,83,79,76,73,71,69,67,66,65,64,64,64,64,64,64,65,65,67,68,70,72,75,78,81,85,90,96,101,102,96,90,86,82,79,76,73,71,69,67,66,65,64,64,64,64,64,64,65,65,67,68,70,72,75,78,81,85,90,95,101,101,96,90,86,82,78,75,73,71,69,67,66,65,64,64,64,64,64,64,64,65,66,68,70,72,75,77,81,85,89,95,101,101,96,90,86,82,78,75,73,71,69,67,66,65,64,64,64,64,64,64,64,65,66,68,70,72,74,77,81,85,89,95,100,101,95,90,86,82,78,75,73,71,69,67,66,65,64,64,64,64,64,64,65,65,66,68,70,72,74,77,81,85,90,95,100,101,96,90,86,82,78,76,73,71,69,67,66,65,65,64,64,64,64,64,65,65,66,68,70,72,75,78,81,85,90,95,101,101,96,91,86,82,79,76,73,71,69,67,66,65,65,64,64,64,64,64,65,65,67,68,70,72,75,78,81,85,90,95,101,102,96,91,87,83,79,76,74,71,69,68,66,65,65,64,64,64,64,65,65,66,67,68,70,73,75,78,82,85,90,96,101,102,97,91,87,83,80,77,74,72,70,68,66,65,65,65,65,64,64,65,65,66,67,69,71,73,76,78,82,86,91,96,102,103,97,92,87,84,80,77,74,72,70,68,67,66,65,65,65,64,65,65,65,66,68,69,71,73,76,79,82,87,91,97,103,104,98,93,88,84,81,78,75,73,71,69,67,66,65,65,65,65,65,65,66,67,68,70,72,74,77,80,83,87,92,98,104,105,99,94,89,85,82,78,76,73,71,69,68,67,66,65,65,65,65,66,67,68,69,71,72,75,77,80,84,88,93,99,105,106,100,95,90,86,82,79,76,74,72,70,69,68,67,66,66,66,66,67,67,68,70,71,73,75,78,81,85,89,94,100,106,108,102,96,91,87,83,80,77,75,73,71,70,68,68,67,67,66,67,67,68,69,70,72,74,76,79,82,86,90,95,101,108,110,103,97,92,88,84,81,78,76,74,72,71,69,68,68,67,67,68,68,69,70,71,73,75,77,80,83,87,91,97,103,109,111,105,99,93,89,85,82,79,77,75,73,72,70,69,69,68,68,69,69,70,71,72,74,76,79,81,84,88,93,98,105,111,113,107,101,95,91,87,84,81,78,76,74,73,72,71,70,70,70,70,70,71,72,74,75,77,80,82,86,90,94,100,107,113,116,109,102,97,92,88,85,82,79,77,75,74,72,72,71,71,71,71,71,72,73,75,76,78,81,84,87,91,96,101,108,115};

// CALIBRATION_GAMMA
static uint16_t _calibration_gamma[]
 = {0,347,539,679,794,894,982,1062,1136,1204,1268,1329,1386,1441,1493,1543,1591,1638,1683,1726,1768,1809,1849,1888,1926,1963,1999,2034,2068,2102,2135,2168,2200,2231,2262,2292,2322,2351,2380,2408,2436,2463,2491,2517,2544,2570,2596,2621,2646,2671,2695,2719,2743,2767,2790,2814,2836,2859,2882,2904,2926,2948,2969,2990,3012,3033,3053,3074,3094,3115,3135,3155,3174,3194,3213,3233,3252,3271,3290,3308,3327,3345,3364,3382,3400,3418,3436,3453,3471,3488,3506,3523,3540,3557,3574,3591,3607,3624,3640,3657,3673,3689,3705,3721,3737,3753,3769,3785,3800,3816,3831,3846,3862,3877,3892,3907,3922,3937,3951,3966,3981,3995,4010,4024,4039,4053,4067,4081,4095};

// RR RG RB GR GG GB BR BG BB
static uint16_t _calibration_mt_absolute_ls_a_ccm[]
 = {409,0,32921,32914,492,32858,32771,33156,647};

// RR RG RB GR GG GB BR BG BB
static uint16_t _calibration_mt_absolute_ls_d40_ccm[]
 = {451,32885,32846,32893,456,32843,27,32996,457};

// RR RG RB GR GG GB BR BG BB
static uint16_t _calibration_mt_absolute_ls_d50_ccm[]
 = {473,32912,32841,32856,447,32871,3,32926,411};

// CALIBRATION_LUT3D_MEM
static uint32_t _calibration_lut3d_mem[]
 = {0, 33554432, 32768, 33587200, 32, 33554464, 32800, 33587232, 67108864, 100663296, 67141632, 100696064, 67108896, 100663328, 67141664, 100696096, 134217728, 167772160, 134250496, 167804928, 134217760, 167772192, 134250528, 167804960, 201326592, 234881024, 201359360, 234913792, 201326624, 234881056, 201359392, 234913824, 268435456, 0, 268468224, 0, 268435488, 0, 268468256, 0, 65536, 33619968, 98304, 33652736, 65568, 33620000, 98336, 33652768, 67174400, 100728832, 67207168, 100761600, 67174432, 100728864, 67207200, 100761632, 134283264, 167837696, 134316032, 167870464, 134283296, 167837728, 134316064, 167870496, 201392128, 234946560, 201424896, 234979328, 201392160, 234946592, 201424928, 234979360, 268500992, 0, 268533760, 0, 268501024, 0, 268533792, 0, 131072, 33685504, 163840, 33718272, 131104, 33685536, 163872, 33718304, 67239936, 100794368, 67272704, 100827136, 67239968, 100794400, 67272736, 100827168, 134348800, 167903232, 134381568, 167936000, 134348832, 167903264, 134381600, 167936032, 201457664, 235012096, 201490432, 235044864, 201457696, 235012128, 201490464, 235044896, 268566528, 0, 268599296, 0, 268566560, 0, 268599328, 0, 196608, 33751040, 229376, 33783808, 196640, 33751072, 229408, 33783840, 67305472, 100859904, 67338240, 100892672, 67305504, 100859936, 67338272, 100892704, 134414336, 167968768, 134447104, 168001536, 134414368, 167968800, 134447136, 168001568, 201523200, 235077632, 201555968, 235110400, 201523232, 235077664, 201556000, 235110432, 268632064, 0, 268664832, 0, 268632096, 0, 268664864, 0, 262144, 33816576, 0, 0, 262176, 33816608, 0, 0, 67371008, 100925440, 0, 0, 67371040, 100925472, 0, 0, 134479872, 168034304, 0, 0, 134479904, 168034336, 0, 0, 201588736, 235143168, 0, 0, 201588768, 235143200, 0, 0, 268697600, 0, 0, 0, 268697632, 0, 0, 0, 64, 33554496, 32832, 33587264, 96, 33554528, 32864, 33587296, 67108928, 100663360, 67141696, 100696128, 67108960, 100663392, 67141728, 100696160, 134217792, 167772224, 134250560, 167804992, 134217824, 167772256, 134250592, 167805024, 201326656, 234881088, 201359424, 234913856, 201326688, 234881120, 201359456, 234913888, 268435520, 0, 268468288, 0, 268435552, 0, 268468320, 0, 65600, 33620032, 98368, 33652800, 65632, 33620064, 98400, 33652832, 67174464, 100728896, 67207232, 100761664, 67174496, 100728928, 67207264, 100761696, 134283328, 167837760, 134316096, 167870528, 134283360, 167837792, 134316128, 167870560, 201392192, 234946624, 201424960, 234979392, 201392224, 234946656, 201424992, 234979424, 268501056, 0, 268533824, 0, 268501088, 0, 268533856, 0, 131136, 33685568, 163904, 33718336, 131168, 33685600, 163936, 33718368, 67240000, 100794432, 67272768, 100827200, 67240032, 100794464, 67272800, 100827232, 134348864, 167903296, 134381632, 167936064, 134348896, 167903328, 134381664, 167936096, 201457728, 235012160, 201490496, 235044928, 201457760, 235012192, 201490528, 235044960, 268566592, 0, 268599360, 0, 268566624, 0, 268599392, 0, 196672, 33751104, 229440, 33783872, 196704, 33751136, 229472, 33783904, 67305536, 100859968, 67338304, 100892736, 67305568, 100860000, 67338336, 100892768, 134414400, 167968832, 134447168, 168001600, 134414432, 167968864, 134447200, 168001632, 201523264, 235077696, 201556032, 235110464, 201523296, 235077728, 201556064, 235110496, 268632128, 0, 268664896, 0, 268632160, 0, 268664928, 0, 262208, 33816640, 0, 0, 262240, 33816672, 0, 0, 67371072, 100925504, 0, 0, 67371104, 100925536, 0, 0, 134479936, 168034368, 0, 0, 134479968, 168034400, 0, 0, 201588800, 235143232, 0, 0, 201588832, 235143264, 0, 0, 268697664, 0, 0, 0, 268697696, 0, 0, 0, 128, 33554560, 32896, 33587328, 160, 33554592, 32928, 33587360, 67108992, 100663424, 67141760, 100696192, 67109024, 100663456, 67141792, 100696224, 134217856, 167772288, 134250624, 167805056, 134217888, 167772320, 134250656, 167805088, 201326720, 234881152, 201359488, 234913920, 201326752, 234881184, 201359520, 234913952, 268435584, 0, 268468352, 0, 268435616, 0, 268468384, 0, 65664, 33620096, 98432, 33652864, 65696, 33620128, 98464, 33652896, 67174528, 100728960, 67207296, 100761728, 67174560, 100728992, 67207328, 100761760, 134283392, 167837824, 134316160, 167870592, 134283424, 167837856, 134316192, 167870624, 201392256, 234946688, 201425024, 234979456, 201392288, 234946720, 201425056, 234979488, 268501120, 0, 268533888, 0, 268501152, 0, 268533920, 0, 131200, 33685632, 163968, 33718400, 131232, 33685664, 164000, 33718432, 67240064, 100794496, 67272832, 100827264, 67240096, 100794528, 67272864, 100827296, 134348928, 167903360, 134381696, 167936128, 134348960, 167903392, 134381728, 167936160, 201457792, 235012224, 201490560, 235044992, 201457824, 235012256, 201490592, 235045024, 268566656, 0, 268599424, 0, 268566688, 0, 268599456, 0, 196736, 33751168, 229504, 33783936, 196768, 33751200, 229536, 33783968, 67305600, 100860032, 67338368, 100892800, 67305632, 100860064, 67338400, 100892832, 134414464, 167968896, 134447232, 168001664, 134414496, 167968928, 134447264, 168001696, 201523328, 235077760, 201556096, 235110528, 201523360, 235077792, 201556128, 235110560, 268632192, 0, 268664960, 0, 268632224, 0, 268664992, 0, 262272, 33816704, 0, 0, 262304, 33816736, 0, 0, 67371136, 100925568, 0, 0, 67371168, 100925600, 0, 0, 134480000, 168034432, 0, 0, 134480032, 168034464, 0, 0, 201588864, 235143296, 0, 0, 201588896, 235143328, 0, 0, 268697728, 0, 0, 0, 268697760, 0, 0, 0, 192, 33554624, 32960, 33587392, 224, 33554656, 32992, 33587424, 67109056, 100663488, 67141824, 100696256, 67109088, 100663520, 67141856, 100696288, 134217920, 167772352, 134250688, 167805120, 134217952, 167772384, 134250720, 167805152, 201326784, 234881216, 201359552, 234913984, 201326816, 234881248, 201359584, 234914016, 268435648, 0, 268468416, 0, 268435680, 0, 268468448, 0, 65728, 33620160, 98496, 33652928, 65760, 33620192, 98528, 33652960, 67174592, 100729024, 67207360, 100761792, 67174624, 100729056, 67207392, 100761824, 134283456, 167837888, 134316224, 167870656, 134283488, 167837920, 134316256, 167870688, 201392320, 234946752, 201425088, 234979520, 201392352, 234946784, 201425120, 234979552, 268501184, 0, 268533952, 0, 268501216, 0, 268533984, 0, 131264, 33685696, 164032, 33718464, 131296, 33685728, 164064, 33718496, 67240128, 100794560, 67272896, 100827328, 67240160, 100794592, 67272928, 100827360, 134348992, 167903424, 134381760, 167936192, 134349024, 167903456, 134381792, 167936224, 201457856, 235012288, 201490624, 235045056, 201457888, 235012320, 201490656, 235045088, 268566720, 0, 268599488, 0, 268566752, 0, 268599520, 0, 196800, 33751232, 229568, 33784000, 196832, 33751264, 229600, 33784032, 67305664, 100860096, 67338432, 100892864, 67305696, 100860128, 67338464, 100892896, 134414528, 167968960, 134447296, 168001728, 134414560, 167968992, 134447328, 168001760, 201523392, 235077824, 201556160, 235110592, 201523424, 235077856, 201556192, 235110624, 268632256, 0, 268665024, 0, 268632288, 0, 268665056, 0, 262336, 33816768, 0, 0, 262368, 33816800, 0, 0, 67371200, 100925632, 0, 0, 67371232, 100925664, 0, 0, 134480064, 168034496, 0, 0, 134480096, 168034528, 0, 0, 201588928, 235143360, 0, 0, 201588960, 235143392, 0, 0, 268697792, 0, 0, 0, 268697824, 0, 0, 0, 256, 33554688, 33024, 33587456, 0, 0, 0, 0, 67109120, 100663552, 67141888, 100696320, 0, 0, 0, 0, 134217984, 167772416, 134250752, 167805184, 0, 0, 0, 0, 201326848, 234881280, 201359616, 234914048, 0, 0, 0, 0, 268435712, 0, 268468480, 0, 0, 0, 0, 0, 65792, 33620224, 98560, 33652992, 0, 0, 0, 0, 67174656, 100729088, 67207424, 100761856, 0, 0, 0, 0, 134283520, 167837952, 134316288, 167870720, 0, 0, 0, 0, 201392384, 234946816, 201425152, 234979584, 0, 0, 0, 0, 268501248, 0, 268534016, 0, 0, 0, 0, 0, 131328, 33685760, 164096, 33718528, 0, 0, 0, 0, 67240192, 100794624, 67272960, 100827392, 0, 0, 0, 0, 134349056, 167903488, 134381824, 167936256, 0, 0, 0, 0, 201457920, 235012352, 201490688, 235045120, 0, 0, 0, 0, 268566784, 0, 268599552, 0, 0, 0, 0, 0, 196864, 33751296, 229632, 33784064, 0, 0, 0, 0, 67305728, 100860160, 67338496, 100892928, 0, 0, 0, 0, 134414592, 167969024, 134447360, 168001792, 0, 0, 0, 0, 201523456, 235077888, 201556224, 235110656, 0, 0, 0, 0, 268632320, 0, 268665088, 0, 0, 0, 0, 0, 262400, 33816832, 0, 0, 0, 0, 0, 0, 67371264, 100925696, 0, 0, 0, 0, 0, 0, 134480128, 168034560, 0, 0, 0, 0, 0, 0, 201588992, 235143424, 0, 0, 0, 0, 0, 0, 268697856, 0, 0, 0, 0, 0, 0, 0};

// CALIBRATION_LIGHT_SRC
static uint16_t _calibration_light_src[]
 = {236,179};

// CALIBRATION_RG_POS
static uint16_t _calibration_rg_pos[]
 = {184,199,218,236,256,273,292,311,329,348,367,385,404,422,460};

// CALIBRATION_BG_POS
static uint16_t _calibration_bg_pos[]
 = {115,135,150,165,180,195,210,225,240,256,270,285,300,315,344};

// CALIBRATION_MESH_RGBG_WEIGHT
static uint16_t _calibration_mesh_rgbg_weight[][15]
 =  {
  { 0, 0, 0, 0, 1, 2, 4, 10, 21, 40, 64, 91, 125, 161, 210 },
  { 0, 0, 0, 2, 8, 16, 32, 58, 94, 144, 192, 227, 256, 256, 256 },
  { 0, 0, 1, 8, 30, 55, 93, 142, 193, 256, 256, 256, 256, 256, 211 },
  { 0, 0, 3, 20, 78, 137, 191, 241, 256, 256, 256, 245, 207, 167, 105 },
  { 0, 1, 6, 35, 132, 256, 256, 256, 256, 235, 185, 141, 103, 72, 34 },
  { 0, 1, 12, 57, 175, 256, 256, 231, 185, 133, 87, 55, 35, 21, 7 },
  { 0, 3, 22, 87, 218, 256, 221, 131, 88, 52, 28, 15, 8, 4, 1 },
  { 3, 13, 37, 125, 256, 256, 183, 65, 29, 14, 6, 3, 1, 1, 0 },
  { 8, 30, 105, 256, 256, 256, 143, 42, 8, 3, 1, 0, 0, 0, 0 },
  { 20, 62, 168, 256, 256, 236, 103, 25, 4, 0, 0, 0, 0, 0, 0 },
  { 41, 105, 227, 256, 244, 190, 73, 15, 2, 0, 0, 0, 0, 0, 0 },
  { 77, 165, 256, 256, 183, 81, 21, 8, 1, 0, 0, 0, 0, 0, 0 },
  { 125, 221, 256, 249, 121, 43, 9, 1, 0, 0, 0, 0, 0, 0, 0 },
  { 176, 256, 256, 188, 71, 20, 3, 0, 0, 0, 0, 0, 0, 0, 0 },
  { 224, 254, 165, 64, 16, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};

// CALIBRATION_MESH_LS_WEIGHT
static uint16_t _calibration_mesh_ls_weight[][15]
 =  {
  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
  { 0, 0, 3, 4, 25, 42, 53, 57, 53, 42, 25, 4, 3, 0, 0 },
  { 0, 0, 4, 131, 157, 179, 193, 198, 193, 179, 157, 131, 4, 0, 0 },
  { 0, 0, 25, 157, 188, 214, 232, 238, 232, 214, 188, 157, 25, 0, 0 },
  { 0, 0, 42, 179, 214, 243, 255, 256, 255, 243, 214, 179, 42, 0, 0 },
  { 0, 0, 53, 193, 232, 255, 256, 256, 256, 255, 232, 193, 53, 0, 0 },
  { 0, 0, 57, 198, 238, 256, 256, 256, 256, 256, 238, 198, 57, 0, 0 },
  { 0, 0, 53, 193, 232, 255, 256, 256, 256, 255, 232, 193, 53, 0, 0 },
  { 0, 0, 42, 179, 214, 243, 255, 256, 255, 243, 214, 179, 42, 0, 0 },
  { 0, 0, 25, 157, 188, 214, 232, 238, 232, 214, 188, 157, 25, 0, 0 },
  { 0, 0, 4, 131, 157, 179, 193, 198, 193, 179, 157, 131, 4, 0, 0 },
  { 0, 0, 3, 4, 25, 42, 53, 57, 53, 42, 25, 4, 3, 0, 0 },
  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};

// CALIBRATION_MESH_COLOR_TEMPERATURE
static uint16_t _calibration_mesh_color_temperature[][15]
 =  {
  { 263, 263, 263, 263, 267, 283, 302, 320, 337, 356, 361, 367, 374, 380, 385 },
  { 263, 263, 263, 263, 263, 276, 294, 312, 329, 348, 359, 365, 372, 378, 385 },
  { 263, 263, 263, 263, 263, 270, 288, 306, 324, 342, 358, 364, 370, 377, 385 },
  { 251, 256, 263, 263, 263, 264, 282, 301, 318, 336, 354, 362, 369, 375, 385 },
  { 239, 244, 250, 256, 263, 263, 276, 295, 312, 330, 349, 361, 367, 374, 385 },
  { 226, 231, 238, 244, 250, 256, 271, 289, 306, 324, 343, 359, 366, 372, 385 },
  { 214, 219, 225, 231, 238, 244, 250, 283, 300, 319, 337, 358, 364, 370, 385 },
  { 193, 199, 213, 219, 225, 231, 237, 244, 294, 313, 331, 348, 363, 369, 385 },
  { 185, 190, 197, 206, 213, 219, 225, 231, 237, 307, 325, 342, 361, 367, 381 },
  { 176, 181, 188, 195, 200, 205, 212, 218, 224, 301, 319, 336, 359, 366, 379 },
  { 168, 174, 180, 187, 194, 200, 200, 206, 212, 219, 313, 331, 349, 364, 378 },
  { 161, 165, 172, 178, 186, 192, 198, 200, 200, 206, 212, 325, 343, 363, 376 },
  { 158, 160, 164, 170, 177, 183, 190, 197, 265, 284, 200, 206, 337, 361, 374 },
  { 154, 157, 160, 162, 169, 175, 182, 188, 195, 278, 296, 313, 200, 360, 373 },
  { 154, 154, 154, 156, 159, 162, 165, 172, 179, 185, 192, 199, 320, 338, 370 }
};

// RG, BG, MULT. final wb gain adjuster for a sky scene. devided by CALIBRATION_WB_STRENGTH_MULT in use
static uint16_t _calibration_wb_strength[]
 = {1000,1000,1000};

// lux threshold for sky
static uint16_t _calibration_sky_lux_th[]
 = {10000};

// 1D rg/bg readout from color_temp
static uint16_t _calibration_ct_rg_pos_calc[]
 = {199,219,248,256,282,367,440};

// 1D rg/bg readout from color_temp
static uint16_t _calibration_ct_bg_pos_calc[]
 = {330,303,255,256,191,157,136};

// CALIBRATION_COLOR_TEMP
static uint16_t _calibration_color_temp[]
 = {154,163,200,200,263,357,385};

// CALIBRATION_CT65POS
static uint16_t _calibration_ct65pos[]
 = {0};

// CALIBRATION_CT40POS
static uint16_t _calibration_ct40pos[]
 = {6};

// CALIBRATION_CT30POS
static uint16_t _calibration_ct30pos[]
 = {5};

// CALIBRATION_EVTOLUX_EV_LUT
static uint32_t _calibration_evtolux_ev_lut[]
 = {0,0,43067,85757,157649,217030,480071,723893,948236,1214813,1426856,1704510,1963882,2854472};

// CALIBRATION_EVTOLUX_LUX_LUT
static uint32_t _calibration_evtolux_lux_lut[]
 = {20480,10240,8600,7500,6030,5120,2560,1280,640,360,200,100,50,10};

// sequence: 1.DAY_LIGHT, 2.CLOUDY, 3.INCANDESCENT, 4.FLOURESCENT, 5.TWILIGHT, 6.SHADE, 7.WARM_FLOURESCENT
static uint16_t _calibration_awb_scene_presets[][2]
 =  {
  { 264, 257 },
  { 329, 199 },
  { 179, 417 },
  { 232, 343 },
  { 232, 343 },
  { 329, 199 },
  { 179, 417 }
};

// 1.enable_ML 2.low_Lux_th, 3.high_Lux_th, 4.contrast_th, 5.bg_th, 6.bg_weight, 7.rg_high_lux_max, 8.rg_high_lux_min
static uint32_t _awb_mixed_light_parameters[]
 = {0,600,2500,40000,500,0,300,256};

// AWB COLOUR PREFERENCE
static uint16_t _calibration_awb_warming_cct[]
 = {7500,6000,4700,2800};

// R G B
static uint16_t _calibration_awb_warming_ls_a[]
 = {256,256,256};

// R G B
static uint16_t _calibration_awb_warming_ls_d75[]
 = {256,256,256};

// R G B
static uint16_t _calibration_awb_warming_ls_d50[]
 = {256,256,256};

// CALIBRATION_STATIC_WB
static uint16_t _calibration_static_wb[]
 = {390,256,256,499};

// CALIBRATION_IRIDIX_ASYMMETRY
static uint16_t _calibration_iridix_asymmetry[]
 = {0,3927,7517,10810,13842,16644,19240,21652,23899,25997,27962,29804,31536,33166,34704,36157,37532,38836,40072,41248,42366,43431,44448,45418,46345,47232,48082,48897,49678,50428,51149,51843,52510,53153,53772,54370,54946,55503,56041,56561,57064,57551,58023,58480,58923,59352,59769,60174,60567,60948,61319,61680,62031,62372,62705,63028,63343,63651,63950,64242,64527,64805,65076,65341,65535};

// CALIBRATION_CA_CORRECTION_MEM
static uint16_t _calibration_ca_correction_mem[][10]
 =  {
  { 4, 11, 65503, 23, 65527, 14, 65527, 8, 65533, 65513 },
  { 9, 65523, 5, 65531, 65525, 12, 9, 2, 65535, 65530 },
  { 65507, 65524, 65527, 0, 58, 23, 2, 7, 65529, 65465 },
  { 65512, 65529, 65497, 29, 46, 42, 65518, 65507, 40, 65487 }
};

// CALIBRATION_CA_CORRECTION
static uint16_t _calibration_ca_correction[]
 = {0,85,48};

// CALIBRATION_CA_FILTER_MEM
static uint32_t _calibration_ca_filter_mem[]
 = {32768,229629,491259,4278943225,4279204855,4262689525,4246239220,4229788915,4213338610,4196888050,4197214450,4180763890,4164313330,4147928050,4131477235,4115091955,4098641140,4082190325,4082516470,4066065655,4066391800,4066652665,4066913530,4067239930,4067500795,4084473340,4101445885,4118418430,4152037375,4185721855,4219340544,4253025024};

static uint32_t _calibration_decompander0_mem[] = {0, 32768, 65536, 98304, 131072, 163840, 196608, 229376, 262144, 294912, 327680, 360448, 393216, 425984, 458752, 491520, 524288, 557055, 589823, 622591, 655359, 688127, 720895, 753663, 786431, 819199, 851967, 884735, 917503, 950271, 983039, 1015807, 1048575};
static uint32_t _calibration_decompander1_mem[] = {0, 4096, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 45056, 49152, 53248, 57344, 61440, 65536, 69632, 73728, 77824, 81920, 86016, 90112, 94208, 98304, 102400, 106496, 110592, 114688, 118784, 122880, 126976, 131072, 135168, 139264, 143360, 147456, 151552, 155648, 159744, 163840, 167936, 172032, 176128, 180224, 184320, 188416, 192512, 196608, 200704, 204800, 208896, 212992, 217088, 221184, 225280, 229376, 233472, 237568, 241664, 245760, 249856, 253952, 258048, 262144, 266240, 270336, 274432, 278528, 282624, 286720, 290816, 294912, 299008, 303104, 307200, 311296, 315392, 319488, 323584, 327680, 331776, 335872, 339968, 344064, 348160, 352256, 356352, 360448, 364544, 368640, 372736, 376832, 380928, 385024, 389120, 393216, 397312, 401408, 405504, 409600, 413696, 417792, 421888, 425984, 430080, 434176, 438272, 442368, 446464, 450560, 454656, 458752, 462848, 466944, 471040, 475136, 479232, 483328, 487424, 491520, 495616, 499712, 503808, 507904, 512000, 516096, 520192, 524288, 528383, 532479, 536575, 540671, 544767, 548863, 552959, 557055, 561151, 565247, 569343, 573439, 577535, 581631, 585727, 589823, 593919, 598015, 602111, 606207, 610303, 614399, 618495, 622591, 626687, 630783, 634879, 638975, 643071, 647167, 651263, 655359, 659455, 663551, 667647, 671743, 675839, 679935, 684031, 688127, 692223, 696319, 700415, 704511, 708607, 712703, 716799, 720895, 724991, 729087, 733183, 737279, 741375, 745471, 749567, 753663, 757759, 761855, 765951, 770047, 774143, 778239, 782335, 786431, 790527, 794623, 798719, 802815, 806911, 811007, 815103, 819199, 823295, 827391, 831487, 835583, 839679, 843775, 847871, 851967, 856063, 860159, 864255, 868351, 872447, 876543, 880639, 884735, 888831, 892927, 897023, 901119, 905215, 909311, 913407, 917503, 921599, 925695, 929791, 933887, 937983, 942079, 946175, 950271, 954367, 958463, 962559, 966655, 970751, 974847, 978943, 983039, 987135, 991231, 995327, 999423, 1003519, 1007615, 1011711, 1015807, 1019903, 1023999, 1028095, 1032191, 1036287, 1040383, 1044479, 1048575};


static LookupTable calibration_black_level_r = { .ptr = _calibration_black_level_r, .cols = 2, .rows = sizeof(_calibration_black_level_r) / sizeof(_calibration_black_level_r[0]), .width = sizeof(_calibration_black_level_r[0][0] ) };
static LookupTable calibration_black_level_gr = { .ptr = _calibration_black_level_gr, .cols = 2, .rows = sizeof(_calibration_black_level_gr) / sizeof(_calibration_black_level_gr[0]), .width = sizeof(_calibration_black_level_gr[0][0] ) };
static LookupTable calibration_black_level_gb = { .ptr = _calibration_black_level_gb, .cols = 2, .rows = sizeof(_calibration_black_level_gb) / sizeof(_calibration_black_level_gb[0]), .width = sizeof(_calibration_black_level_gb[0][0] ) };
static LookupTable calibration_black_level_b = { .ptr = _calibration_black_level_b, .cols = 2, .rows = sizeof(_calibration_black_level_b) / sizeof(_calibration_black_level_b[0]), .width = sizeof(_calibration_black_level_b[0][0] ) };
static LookupTable calibration_noise_profile = { .ptr = _calibration_noise_profile, .rows = 1, .cols = sizeof(_calibration_noise_profile) / sizeof(_calibration_noise_profile[0]), .width = sizeof(_calibration_noise_profile[0] ) };
static LookupTable calibration_demosaic = { .ptr = _calibration_demosaic, .rows = 1, .cols = sizeof(_calibration_demosaic) / sizeof(_calibration_demosaic[0]), .width = sizeof(_calibration_demosaic[0] ) };
static LookupTable calibration_wdr_np_lut = { .ptr = _calibration_wdr_np_lut, .rows = 1, .cols = sizeof(_calibration_wdr_np_lut) / sizeof(_calibration_wdr_np_lut[0]), .width = sizeof(_calibration_wdr_np_lut[0] ) };
static LookupTable calibration_shading_radial_r = { .ptr = _calibration_shading_radial_r, .rows = 1, .cols = sizeof(_calibration_shading_radial_r) / sizeof(_calibration_shading_radial_r[0]), .width = sizeof(_calibration_shading_radial_r[0] ) };
static LookupTable calibration_shading_radial_g = { .ptr = _calibration_shading_radial_g, .rows = 1, .cols = sizeof(_calibration_shading_radial_g) / sizeof(_calibration_shading_radial_g[0]), .width = sizeof(_calibration_shading_radial_g[0] ) };
static LookupTable calibration_shading_radial_b = { .ptr = _calibration_shading_radial_b, .rows = 1, .cols = sizeof(_calibration_shading_radial_b) / sizeof(_calibration_shading_radial_b[0]), .width = sizeof(_calibration_shading_radial_b[0] ) };
static LookupTable calibration_shading_radial_ir = { .ptr = _calibration_shading_radial_ir, .rows = 1, .cols = sizeof(_calibration_shading_radial_ir) / sizeof(_calibration_shading_radial_ir[0]), .width = sizeof(_calibration_shading_radial_ir[0] ) };
static LookupTable calibration_shading_radial_centre_and_mult = { .ptr = _calibration_shading_radial_centre_and_mult, .rows = 1, .cols = sizeof(_calibration_shading_radial_centre_and_mult) / sizeof(_calibration_shading_radial_centre_and_mult[0]), .width = sizeof(_calibration_shading_radial_centre_and_mult[0] ) };
static LookupTable calibration_shading_ls_a_r = { .ptr = _calibration_shading_ls_a_r, .rows = 1, .cols = sizeof(_calibration_shading_ls_a_r) / sizeof(_calibration_shading_ls_a_r[0]), .width = sizeof(_calibration_shading_ls_a_r[0] ) };
static LookupTable calibration_shading_ls_a_g = { .ptr = _calibration_shading_ls_a_g, .rows = 1, .cols = sizeof(_calibration_shading_ls_a_g) / sizeof(_calibration_shading_ls_a_g[0]), .width = sizeof(_calibration_shading_ls_a_g[0] ) };
static LookupTable calibration_shading_ls_a_b = { .ptr = _calibration_shading_ls_a_b, .rows = 1, .cols = sizeof(_calibration_shading_ls_a_b) / sizeof(_calibration_shading_ls_a_b[0]), .width = sizeof(_calibration_shading_ls_a_b[0] ) };
static LookupTable calibration_shading_ls_tl84_r = { .ptr = _calibration_shading_ls_tl84_r, .rows = 1, .cols = sizeof(_calibration_shading_ls_tl84_r) / sizeof(_calibration_shading_ls_tl84_r[0]), .width = sizeof(_calibration_shading_ls_tl84_r[0] ) };
static LookupTable calibration_shading_ls_tl84_g = { .ptr = _calibration_shading_ls_tl84_g, .rows = 1, .cols = sizeof(_calibration_shading_ls_tl84_g) / sizeof(_calibration_shading_ls_tl84_g[0]), .width = sizeof(_calibration_shading_ls_tl84_g[0] ) };
static LookupTable calibration_shading_ls_tl84_b = { .ptr = _calibration_shading_ls_tl84_b, .rows = 1, .cols = sizeof(_calibration_shading_ls_tl84_b) / sizeof(_calibration_shading_ls_tl84_b[0]), .width = sizeof(_calibration_shading_ls_tl84_b[0] ) };
static LookupTable calibration_shading_ls_d65_r = { .ptr = _calibration_shading_ls_d65_r, .rows = 1, .cols = sizeof(_calibration_shading_ls_d65_r) / sizeof(_calibration_shading_ls_d65_r[0]), .width = sizeof(_calibration_shading_ls_d65_r[0] ) };
static LookupTable calibration_shading_ls_d65_g = { .ptr = _calibration_shading_ls_d65_g, .rows = 1, .cols = sizeof(_calibration_shading_ls_d65_g) / sizeof(_calibration_shading_ls_d65_g[0]), .width = sizeof(_calibration_shading_ls_d65_g[0] ) };
static LookupTable calibration_shading_ls_d65_b = { .ptr = _calibration_shading_ls_d65_b, .rows = 1, .cols = sizeof(_calibration_shading_ls_d65_b) / sizeof(_calibration_shading_ls_d65_b[0]), .width = sizeof(_calibration_shading_ls_d65_b[0] ) };
static LookupTable calibration_gamma = { .ptr = _calibration_gamma, .rows = 1, .cols = sizeof(_calibration_gamma) / sizeof(_calibration_gamma[0]), .width = sizeof(_calibration_gamma[0] ) };
static LookupTable calibration_mt_absolute_ls_a_ccm = { .ptr = _calibration_mt_absolute_ls_a_ccm, .rows = 1, .cols = sizeof(_calibration_mt_absolute_ls_a_ccm) / sizeof(_calibration_mt_absolute_ls_a_ccm[0]), .width = sizeof(_calibration_mt_absolute_ls_a_ccm[0] ) };
static LookupTable calibration_mt_absolute_ls_d40_ccm = { .ptr = _calibration_mt_absolute_ls_d40_ccm, .rows = 1, .cols = sizeof(_calibration_mt_absolute_ls_d40_ccm) / sizeof(_calibration_mt_absolute_ls_d40_ccm[0]), .width = sizeof(_calibration_mt_absolute_ls_d40_ccm[0] ) };
static LookupTable calibration_mt_absolute_ls_d50_ccm = { .ptr = _calibration_mt_absolute_ls_d50_ccm, .rows = 1, .cols = sizeof(_calibration_mt_absolute_ls_d50_ccm) / sizeof(_calibration_mt_absolute_ls_d50_ccm[0]), .width = sizeof(_calibration_mt_absolute_ls_d50_ccm[0] ) };
static LookupTable calibration_lut3d_mem = { .ptr = _calibration_lut3d_mem, .rows = 1, .cols = sizeof(_calibration_lut3d_mem) / sizeof(_calibration_lut3d_mem[0]), .width = sizeof(_calibration_lut3d_mem[0] ) };
static LookupTable calibration_light_src = { .ptr = _calibration_light_src, .rows = 1, .cols = sizeof(_calibration_light_src) / sizeof(_calibration_light_src[0]), .width = sizeof(_calibration_light_src[0] ) };
static LookupTable calibration_rg_pos = { .ptr = _calibration_rg_pos, .rows = 1, .cols = sizeof(_calibration_rg_pos) / sizeof(_calibration_rg_pos[0]), .width = sizeof(_calibration_rg_pos[0] ) };
static LookupTable calibration_bg_pos = { .ptr = _calibration_bg_pos, .rows = 1, .cols = sizeof(_calibration_bg_pos) / sizeof(_calibration_bg_pos[0]), .width = sizeof(_calibration_bg_pos[0] ) };
static LookupTable calibration_mesh_rgbg_weight = { .ptr = _calibration_mesh_rgbg_weight, .cols = 15, .rows = sizeof(_calibration_mesh_rgbg_weight) / sizeof(_calibration_mesh_rgbg_weight[0]), .width = sizeof(_calibration_mesh_rgbg_weight[0][0] ) };
static LookupTable calibration_mesh_ls_weight = { .ptr = _calibration_mesh_ls_weight, .cols = 15, .rows = sizeof(_calibration_mesh_ls_weight) / sizeof(_calibration_mesh_ls_weight[0]), .width = sizeof(_calibration_mesh_ls_weight[0][0] ) };
static LookupTable calibration_mesh_color_temperature = { .ptr = _calibration_mesh_color_temperature, .cols = 15, .rows = sizeof(_calibration_mesh_color_temperature) / sizeof(_calibration_mesh_color_temperature[0]), .width = sizeof(_calibration_mesh_color_temperature[0][0] ) };
static LookupTable calibration_wb_strength = { .ptr = _calibration_wb_strength, .rows = 1, .cols = sizeof(_calibration_wb_strength) / sizeof(_calibration_wb_strength[0]), .width = sizeof(_calibration_wb_strength[0] ) };
static LookupTable calibration_sky_lux_th = { .ptr = _calibration_sky_lux_th, .rows = 1, .cols = sizeof(_calibration_sky_lux_th) / sizeof(_calibration_sky_lux_th[0]), .width = sizeof(_calibration_sky_lux_th[0] ) };
static LookupTable calibration_ct_rg_pos_calc = { .ptr = _calibration_ct_rg_pos_calc, .rows = 1, .cols = sizeof(_calibration_ct_rg_pos_calc) / sizeof(_calibration_ct_rg_pos_calc[0]), .width = sizeof(_calibration_ct_rg_pos_calc[0] ) };
static LookupTable calibration_ct_bg_pos_calc = { .ptr = _calibration_ct_bg_pos_calc, .rows = 1, .cols = sizeof(_calibration_ct_bg_pos_calc) / sizeof(_calibration_ct_bg_pos_calc[0]), .width = sizeof(_calibration_ct_bg_pos_calc[0] ) };
static LookupTable calibration_color_temp = { .ptr = _calibration_color_temp, .rows = 1, .cols = sizeof(_calibration_color_temp) / sizeof(_calibration_color_temp[0]), .width = sizeof(_calibration_color_temp[0] ) };
static LookupTable calibration_ct65pos = { .ptr = _calibration_ct65pos, .rows = 1, .cols = sizeof(_calibration_ct65pos) / sizeof(_calibration_ct65pos[0]), .width = sizeof(_calibration_ct65pos[0] ) };
static LookupTable calibration_ct40pos = { .ptr = _calibration_ct40pos, .rows = 1, .cols = sizeof(_calibration_ct40pos) / sizeof(_calibration_ct40pos[0]), .width = sizeof(_calibration_ct40pos[0] ) };
static LookupTable calibration_ct30pos = { .ptr = _calibration_ct30pos, .rows = 1, .cols = sizeof(_calibration_ct30pos) / sizeof(_calibration_ct30pos[0]), .width = sizeof(_calibration_ct30pos[0] ) };
static LookupTable calibration_evtolux_ev_lut = { .ptr = _calibration_evtolux_ev_lut, .rows = 1, .cols = sizeof(_calibration_evtolux_ev_lut) / sizeof(_calibration_evtolux_ev_lut[0]), .width = sizeof(_calibration_evtolux_ev_lut[0] ) };
static LookupTable calibration_evtolux_lux_lut = { .ptr = _calibration_evtolux_lux_lut, .rows = 1, .cols = sizeof(_calibration_evtolux_lux_lut) / sizeof(_calibration_evtolux_lux_lut[0]), .width = sizeof(_calibration_evtolux_lux_lut[0] ) };
static LookupTable calibration_awb_scene_presets = { .ptr = _calibration_awb_scene_presets, .cols = 2, .rows = sizeof(_calibration_awb_scene_presets) / sizeof(_calibration_awb_scene_presets[0]), .width = sizeof(_calibration_awb_scene_presets[0][0] ) };
static LookupTable calibration_awb_mixed_light_parameters = { .ptr = _awb_mixed_light_parameters, .rows = 1, .cols = sizeof(_awb_mixed_light_parameters) / sizeof(_awb_mixed_light_parameters[0]), .width = sizeof(_awb_mixed_light_parameters[0] ) };
static LookupTable calibration_awb_warming_cct = { .ptr = _calibration_awb_warming_cct, .rows = 1, .cols = sizeof(_calibration_awb_warming_cct) / sizeof(_calibration_awb_warming_cct[0]), .width = sizeof(_calibration_awb_warming_cct[0] ) };
static LookupTable calibration_awb_warming_ls_a = { .ptr = _calibration_awb_warming_ls_a, .rows = 1, .cols = sizeof(_calibration_awb_warming_ls_a) / sizeof(_calibration_awb_warming_ls_a[0]), .width = sizeof(_calibration_awb_warming_ls_a[0] ) };
static LookupTable calibration_awb_warming_ls_d75 = { .ptr = _calibration_awb_warming_ls_d75, .rows = 1, .cols = sizeof(_calibration_awb_warming_ls_d75) / sizeof(_calibration_awb_warming_ls_d75[0]), .width = sizeof(_calibration_awb_warming_ls_d75[0] ) };
static LookupTable calibration_awb_warming_ls_d50 = { .ptr = _calibration_awb_warming_ls_d50, .rows = 1, .cols = sizeof(_calibration_awb_warming_ls_d50) / sizeof(_calibration_awb_warming_ls_d50[0]), .width = sizeof(_calibration_awb_warming_ls_d50[0] ) };
static LookupTable calibration_static_wb = { .ptr = _calibration_static_wb, .rows = 1, .cols = sizeof(_calibration_static_wb) / sizeof(_calibration_static_wb[0]), .width = sizeof(_calibration_static_wb[0] ) };
static LookupTable calibration_iridix_asymmetry = { .ptr = _calibration_iridix_asymmetry, .rows = 1, .cols = sizeof(_calibration_iridix_asymmetry) / sizeof(_calibration_iridix_asymmetry[0]), .width = sizeof(_calibration_iridix_asymmetry[0] ) };
static LookupTable calibration_ca_correction_mem = { .ptr = _calibration_ca_correction_mem, .cols = 10, .rows = sizeof(_calibration_ca_correction_mem) / sizeof(_calibration_ca_correction_mem[0]), .width = sizeof(_calibration_ca_correction_mem[0][0] ) };
static LookupTable calibration_ca_correction = { .ptr = _calibration_ca_correction, .rows = 1, .cols = sizeof(_calibration_ca_correction) / sizeof(_calibration_ca_correction[0]), .width = sizeof(_calibration_ca_correction[0] ) };
static LookupTable calibration_ca_filter_mem = { .ptr = _calibration_ca_filter_mem, .rows = 1, .cols = sizeof(_calibration_ca_filter_mem) / sizeof(_calibration_ca_filter_mem[0]), .width = sizeof(_calibration_ca_filter_mem[0] ) };


static LookupTable calibration_decompander0_mem = {.ptr = _calibration_decompander0_mem, .rows = 1, .cols = sizeof( _calibration_decompander0_mem ) / sizeof( _calibration_decompander0_mem[0] ), .width = sizeof( _calibration_decompander0_mem[0] )};
static LookupTable calibration_decompander1_mem = {.ptr = _calibration_decompander1_mem, .rows = 1, .cols = sizeof( _calibration_decompander1_mem ) / sizeof( _calibration_decompander1_mem[0] ), .width = sizeof( _calibration_decompander1_mem[0] )};


uint32_t get_calibrations_static_linear_dummy( ACameraCalibrations *c ) {
//uint32_t get_static( ApicalCalibrations * c ) {
    uint32_t result = 0;
    if (c != 0) {
		c->calibrations[CALIBRATION_DECOMPANDER0_MEM] = &calibration_decompander0_mem;
        c->calibrations[CALIBRATION_DECOMPANDER1_MEM] = &calibration_decompander1_mem;
		
        c->calibrations[CALIBRATION_BLACK_LEVEL_R] = &calibration_black_level_r;
        c->calibrations[CALIBRATION_BLACK_LEVEL_GR] = &calibration_black_level_gr;
        c->calibrations[CALIBRATION_BLACK_LEVEL_GB] = &calibration_black_level_gb;
        c->calibrations[CALIBRATION_BLACK_LEVEL_B] = &calibration_black_level_b;
        c->calibrations[CALIBRATION_NOISE_PROFILE] = &calibration_noise_profile;
        c->calibrations[CALIBRATION_DEMOSAIC] = &calibration_demosaic;
        c->calibrations[CALIBRATION_WDR_NP_LUT] = &calibration_wdr_np_lut;
        c->calibrations[CALIBRATION_SHADING_RADIAL_R] = &calibration_shading_radial_r;
        c->calibrations[CALIBRATION_SHADING_RADIAL_G] = &calibration_shading_radial_g;
        c->calibrations[CALIBRATION_SHADING_RADIAL_B] = &calibration_shading_radial_b;
        c->calibrations[CALIBRATION_SHADING_RADIAL_IR] = &calibration_shading_radial_ir;
        c->calibrations[CALIBRATION_SHADING_RADIAL_CENTRE_AND_MULT] = &calibration_shading_radial_centre_and_mult;
        c->calibrations[CALIBRATION_SHADING_LS_A_R] = &calibration_shading_ls_a_r;
        c->calibrations[CALIBRATION_SHADING_LS_A_G] = &calibration_shading_ls_a_g;
        c->calibrations[CALIBRATION_SHADING_LS_A_B] = &calibration_shading_ls_a_b;
        c->calibrations[CALIBRATION_SHADING_LS_TL84_R] = &calibration_shading_ls_tl84_r;
        c->calibrations[CALIBRATION_SHADING_LS_TL84_G] = &calibration_shading_ls_tl84_g;
        c->calibrations[CALIBRATION_SHADING_LS_TL84_B] = &calibration_shading_ls_tl84_b;
        c->calibrations[CALIBRATION_SHADING_LS_D65_R] = &calibration_shading_ls_d65_r;
        c->calibrations[CALIBRATION_SHADING_LS_D65_G] = &calibration_shading_ls_d65_g;
        c->calibrations[CALIBRATION_SHADING_LS_D65_B] = &calibration_shading_ls_d65_b;
        c->calibrations[CALIBRATION_GAMMA] = &calibration_gamma;
        c->calibrations[CALIBRATION_MT_ABSOLUTE_LS_A_CCM] = &calibration_mt_absolute_ls_a_ccm;
        c->calibrations[CALIBRATION_MT_ABSOLUTE_LS_D40_CCM] = &calibration_mt_absolute_ls_d40_ccm;
        c->calibrations[CALIBRATION_MT_ABSOLUTE_LS_D50_CCM] = &calibration_mt_absolute_ls_d50_ccm;
        c->calibrations[CALIBRATION_LUT3D_MEM] = &calibration_lut3d_mem;
	c->calibrations[CALIBRATION_LUT3D_MEM_A] = NULL;
	c->calibrations[CALIBRATION_LUT3D_MEM_D40] = NULL;
	c->calibrations[CALIBRATION_LUT3D_MEM_D50] = NULL;
        c->calibrations[CALIBRATION_LIGHT_SRC] = &calibration_light_src;
        c->calibrations[CALIBRATION_RG_POS] = &calibration_rg_pos;
        c->calibrations[CALIBRATION_BG_POS] = &calibration_bg_pos;
        c->calibrations[CALIBRATION_MESH_RGBG_WEIGHT] = &calibration_mesh_rgbg_weight;
        c->calibrations[CALIBRATION_MESH_LS_WEIGHT] = &calibration_mesh_ls_weight;
        c->calibrations[CALIBRATION_MESH_COLOR_TEMPERATURE] = &calibration_mesh_color_temperature;
        c->calibrations[CALIBRATION_WB_STRENGTH] = &calibration_wb_strength;
        c->calibrations[CALIBRATION_SKY_LUX_TH] = &calibration_sky_lux_th;
        c->calibrations[CALIBRATION_CT_RG_POS_CALC] = &calibration_ct_rg_pos_calc;
        c->calibrations[CALIBRATION_CT_BG_POS_CALC] = &calibration_ct_bg_pos_calc;
        c->calibrations[CALIBRATION_COLOR_TEMP] = &calibration_color_temp;
        c->calibrations[CALIBRATION_CT65POS] = &calibration_ct65pos;
        c->calibrations[CALIBRATION_CT40POS] = &calibration_ct40pos;
        c->calibrations[CALIBRATION_CT30POS] = &calibration_ct30pos;
        c->calibrations[CALIBRATION_EVTOLUX_EV_LUT] = &calibration_evtolux_ev_lut;
        c->calibrations[CALIBRATION_EVTOLUX_LUX_LUT] = &calibration_evtolux_lux_lut;
        c->calibrations[CALIBRATION_AWB_SCENE_PRESETS] = &calibration_awb_scene_presets;
        c->calibrations[CALIBRATION_AWB_MIX_LIGHT_PARAMETERS] = &calibration_awb_mixed_light_parameters;
        c->calibrations[CALIBRATION_AWB_WARMING_CCT] = &calibration_awb_warming_cct;
        c->calibrations[CALIBRATION_AWB_WARMING_LS_A] = &calibration_awb_warming_ls_a;
        c->calibrations[CALIBRATION_AWB_WARMING_LS_D75] = &calibration_awb_warming_ls_d75;
        c->calibrations[CALIBRATION_AWB_WARMING_LS_D50] = &calibration_awb_warming_ls_d50;
        c->calibrations[CALIBRATION_STATIC_WB] = &calibration_static_wb;
        c->calibrations[CALIBRATION_IRIDIX_ASYMMETRY] = &calibration_iridix_asymmetry;
        c->calibrations[CALIBRATION_CA_CORRECTION_MEM] = &calibration_ca_correction_mem;
        c->calibrations[CALIBRATION_CA_CORRECTION] = &calibration_ca_correction;
        c->calibrations[CALIBRATION_CA_FILTER_MEM] = &calibration_ca_filter_mem;
    } else {
        result = -1;
    }
    return result;
}
